﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Com.CMS263.PO;
using Com.CMS263.BLL;
using Com.CMS263.Util;

namespace Com.CMS263.Web.manage.UserManager
{
    public partial class UserEdit : System.Web.UI.Page
    {
        public int page = 1;
        public int id;
        public CustomerList cus = new CustomerList();
        CustomerListBLL cusBll = new CustomerListBLL();

        public string userNameSou;

        protected void Page_Load(object sender, EventArgs e)
        {
            id = int.Parse(Request["id"]);
            page = int.Parse(Request["page"]);
            userNameSou = Request["username"];
            cus = (CustomerList)cusBll.FindModelById("CustomerList", id);

        }


        protected void Button1_Click(object sender, EventArgs e)
        {
            userNameSou = Request["userNameSou"];
            id = int.Parse(Request["id"]);
            page = int.Parse(Request["page"]);
            cus = (CustomerList)cusBll.FindModelById("CustomerList", id);

            string UserEmail = StringUtil.checkStr(Request["UserEmail"]);
            string UserMobile = StringUtil.checkStr(Request["UserMobile"]);





            cus.UserEmail = UserEmail;
            cus.UserMobile = UserMobile;          
            //cus.MarryProvinceCode = proCodeMarry;
            //cus.MaryyCityCode = cityCodeMarry;
            //cus.MarryAreaCode = areaCodeMarry;
            //cus.MarryAddressRo = MarryAddressRo;
            //cus.MarryAddress = addressMarry;
            cusBll.cus = cus;
            if (cusBll.UpDate())
            {
                StringUtil.Alert("修改成功！", "UserList.aspx?page=" + page + "&&username=" + userNameSou);
            }
            else
            {
                StringUtil.Alert("修改失败！", "-1");

            }
        }

    }
}
